package book;

/**
 * \* Created with IntelliJ IDEA.
 * \* User: Administrator
 * \* Date: 2021/11/17
 * \* Time: 12:25
 * \* To change this template use File | Settings | File Templates.
 * \* Description:
 * \
 */
public class BookList {
    private Book[] books=new Book[10];
    private int useSize;
    public BookList(){
        books[0]=new Book("超人与怪兽","飞龙",11,"小说");
        books[1]=new Book("怪诞之王","在天",13,"小说");
        books[2]=new Book("无极剑圣","良辰",16,"小说");
        this.useSize=3;
    }

    public int getUseSize() {
        return useSize;
    }

    public void setUseSize(int useSize) {
        this.useSize = useSize;
    }

    /**
     * 获取到pos位置的一本书
     * @param pos
     * @return
     */
    public Book getPos(int pos){
        return this.books[pos];
    }

    /**
     * 设置pos下标为一本书【添加一本书
     * @param pos
     * @param book
     */
    public void setBooks(int pos,Book book){
        this.books[pos]=book;
    }
}
